const axios = require('axios')

let api = 'https://api.juejin.cn/content_api/v1/content/article_rank?category_id=1&type=hot&count=3&from=1&aid=2608&uuid=7145810834685003271&spider=0'
// let api = 'http://api1.juejin.cn/content_api/v1/content/article_rank?category_id=1&type=hot&count=3&from=1&aid=2608&uuid=7145810834685003271&spider=0'
axios.get(api).then(r => {
    console.log(r.data)
}).catch(err => {
    console.log('发生错误...')
    console.error(err)
}).finally(() => {
    console.log('最后一定会执行的...')
})

// fetch v18版本之后默认开启
fetch(api).then((res)=> res.json()).then((data)=>{
    console.log(data)
}).catch((err) => {
    console.error('发生错误:', err)
})

